<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:m="http://www.ol4jsf.org"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:o="http://openfaces.org/">

	<strong>
		<h:panelGroup rendered="#{spatialAnalysisHelper.distance != null and spatialAnalysisHelper.distance > 0}">
			<h:outputText value="#{messages['DISTANCE']}" />
			<h:outputText value=" (a #{spatialAnalysisHelper.distance} metros)" />
		</h:panelGroup>
		
		<h:outputText value="#{messages['INTERSECTS']}" rendered="#{spatialAnalysisHelper.distance == null or spatialAnalysisHelper.distance == 0}" />
	</strong>
	<rich:separator lineType="solid"/>
	<br />
	<rich:dataTable var="sar" 
		value="#{spatialAnalysisHelper.distanceResults}"
		width="95%">
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.zone_name']}</f:facet>
			<h:outputText value="#{sar.zoneName}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.location']}</f:facet>
			<h:outputText value="#{sar.locationInCountry}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.current_land_use']}</f:facet>
			<h:outputText value="#{sar.landUse}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.other_land_uses']}</f:facet>
			<h:outputText value="TODO!" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.level']}</f:facet>
			<h:outputText value="#{sar.levelName}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['DISTANCE']}</f:facet>
			<h:outputText value="#{sar.distance}" />
		</rich:column>
		<rich:column rendered="#{spatialAnalysisHelper.ruleGroup != null}">
			<f:facet name="header">#{messages['spatial_analysis.rules']}</f:facet>
			<ui:repeat var="sr" value="#{sar.spatialRuleArray}">
				<a4j:commandLink value="#{generalHelper.spatialRuleText(sr)}"></a4j:commandLink>
				#{'  '}
			</ui:repeat>
		</rich:column>
	</rich:dataTable>
	
	<br />
	<br />
	
	<strong>#{messages['WITHIN']}</strong>
	<rich:separator lineType="solid"/>
	<br />
	<rich:dataTable var="sar" 
		value="#{spatialAnalysisHelper.withinResults}"
		width="95%">
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.zone_name']}</f:facet>
			<h:outputText value="#{sar.zoneName}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.location']}</f:facet>
			<h:outputText value="#{sar.locationInCountry}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.current_land_use']}</f:facet>
			<h:outputText value="#{sar.landUse}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.other_land_uses']}</f:facet>
			<h:outputText value="TODO!" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.level']}</f:facet>
			<h:outputText value="#{sar.levelName}" />
		</rich:column>
		<rich:column rendered="#{spatialAnalysisHelper.ruleGroup != null}">
			<f:facet name="header">#{messages['spatial_analysis.rules']}</f:facet>
			<ui:repeat var="sr" value="#{sar.spatialRuleArray}">
				<a4j:commandLink value="#{generalHelper.spatialRuleText(sr)}"/>
				#{'  '}
			</ui:repeat>
		</rich:column>
	</rich:dataTable>

	<br />
	<br />
	
	<strong>#{messages['CONTAINS']}</strong>
	<rich:separator lineType="solid"/>
	<br />
	<rich:dataTable var="sar"
		value="#{spatialAnalysisHelper.containsResults}"
		width="95%">
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.zone_name']}</f:facet>
			<h:outputText value="#{sar.zoneName}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.location']}</f:facet>
			<h:outputText value="#{sar.locationInCountry}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.current_land_use']}</f:facet>
			<h:outputText value="#{sar.landUse}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.other_land_uses']}</f:facet>
			<h:outputText value="TODO!" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.level']}</f:facet>
			<h:outputText value="#{sar.levelName}" />
		</rich:column>
		<rich:column rendered="#{spatialAnalysisHelper.ruleGroup != null}">
			<f:facet name="header">#{messages['spatial_analysis.rules']}</f:facet>
			<ui:repeat var="sr" value="#{sar.spatialRuleArray}">
				<a4j:commandLink value="#{generalHelper.spatialRuleText(sr)}"/>
				#{'  '}
			</ui:repeat>
		</rich:column>
	</rich:dataTable>

	<br />
	<br />
	
	<strong>#{messages['TOUCH']}</strong>
	<rich:separator lineType="solid"/>
	<br />
	<rich:dataTable var="sar" 
		value="#{spatialAnalysisHelper.touchesResults}"
		width="95%">
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.zone_name']}</f:facet>
			<h:outputText value="#{sar.zoneName}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.location']}</f:facet>
			<h:outputText value="#{sar.locationInCountry}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.current_land_use']}</f:facet>
			<h:outputText value="#{sar.landUse}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.other_land_uses']}</f:facet>
			<h:outputText value="TODO!" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.level']}</f:facet>
			<h:outputText value="#{sar.levelName}" />
		</rich:column>
		<rich:column rendered="#{spatialAnalysisHelper.ruleGroup != null}">
			<f:facet name="header">#{messages['spatial_analysis.rules']}</f:facet>
			<ui:repeat var="sr" value="#{sar.spatialRuleArray}">
				<a4j:commandLink value="#{generalHelper.spatialRuleText(sr)}"/>
				#{'  '}
			</ui:repeat>
		</rich:column>
	</rich:dataTable>
	
	<br />
	<br />
	
	<strong>#{messages['OVERLAP']}</strong>
	<rich:separator lineType="solid"/>
	<br />
	<rich:dataTable var="sar" 
		value="#{spatialAnalysisHelper.overlapsResults}"
		width="95%">
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.zone_name']}</f:facet>
			<h:outputText value="#{sar.zoneName}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.location']}</f:facet>
			<h:outputText value="#{sar.locationInCountry}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.current_land_use']}</f:facet>
			<h:outputText value="#{sar.landUse}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.other_land_uses']}</f:facet>
			<h:outputText value="TODO!" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.level']}</f:facet>
			<h:outputText value="#{sar.levelName}" />
		</rich:column>
		<rich:column rendered="#{spatialAnalysisHelper.ruleGroup != null}">
			<f:facet name="header">#{messages['spatial_analysis.rules']}</f:facet>
			<ui:repeat var="sr" value="#{sar.spatialRuleArray}">
				<a4j:commandLink value="#{generalHelper.spatialRuleText(sr)}"/>
				#{'  '}
			</ui:repeat>
		</rich:column>
	</rich:dataTable>

	<br />
	<br />
	
	<strong>#{messages['CROSS']}</strong>
	<rich:separator lineType="solid"/>
	<br />
	<rich:dataTable var="sar" 
		value="#{spatialAnalysisHelper.crossesResults}"
		width="95%">
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.zone_name']}</f:facet>
			<h:outputText value="#{sar.zoneName}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.location']}</f:facet>
			<h:outputText value="#{sar.locationInCountry}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.current_land_use']}</f:facet>
			<h:outputText value="#{sar.landUse}" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.other_land_uses']}</f:facet>
			<h:outputText value="TODO!" />
		</rich:column>
		<rich:column>
			<f:facet name="header">#{messages['spatial_analysis.level']}</f:facet>
			<h:outputText value="#{sar.levelName}" />
		</rich:column>
		<rich:column rendered="#{spatialAnalysisHelper.ruleGroup != null}">
			<f:facet name="header">#{messages['spatial_analysis.rules']}</f:facet>
			<ui:repeat var="sr" value="#{sar.spatialRuleArray}">
				<a4j:commandLink value="#{generalHelper.spatialRuleText(sr)}"/>
				#{'  '}
			</ui:repeat>
		</rich:column>
	</rich:dataTable>

</ui:composition>
